﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Stdby/Busqueda/MasterPageBusqueda/MasterPageBusqueda.master"
    AutoEventWireup="true" CodeFile="selectGenerador.aspx.cs" Inherits="Stdby_Busqueda_tabOrdenTrabajo_selectGenerador" %>

<%@ Register Src="~/Seguridad/UserControl/SeguridadAutenticador.ascx" TagName="Autenticador"
    TagPrefix="aut" %>
<asp:Content ID="Content1" ContentPlaceHolderID="agregarScript" runat="Server">
    <script type='text/javascript' language="javascript">
        function validar() {
            var movex = document.getElementById('<%= txtMovex.ClientID %>').value;

            if (movex != '' && movex != null) {
                var semi = document.getElementById('<%= txtSemi.ClientID %>').value;
                var tanque = document.getElementById('<%= txtTanque.ClientID %>').value;
                var ringMaster = document.getElementById('<%= txtRingM.ClientID %>').value;
                var tablero = document.getElementById('<%= txtTablero.ClientID %>').value;

                window.opener.cargarMovexGenerador(movex, semi, tanque, ringMaster, tablero);
                window.close();
            }
            else {
                alert('Seleccione un registro.');
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Titulo" runat="Server">
    <div style="text-align: center;">
        <h1>
            Generador</h1>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CamposBusqueda" runat="Server">
    <div align="center">
        <table style="text-align: left; width: 90%;">
            <tr>
                <td style="text-align: left;">
                    Plant Number:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtBuscaMovex" runat="server" Width="100%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: left;">
                    Descripción:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtBuscaDescripcion" runat="server" Width="100%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: left;">
                    N° Cammesa:
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtBuscaNroCammesa" runat="server" Width="100%"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="BotonBusqueda" runat="Server">
    <asp:Button ID="btnBuscar" runat="server" Text="Buscar" OnClick="btnBuscar_Click"
        Width="60%" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="RegistroSeleccionado" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <table style="width: 80%;">
                <tr>
                    <td style="width: 10%;">
                        <strong>Plant Number:</strong>
                    </td>
                    <td style="width: 20%;">
                        <asp:TextBox ID="txtMovex" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                    <td style="width: 10%;">
                        <strong>Descripción:</strong>
                    </td>
                    <td style="width: 20%;">
                        <asp:TextBox ID="txtDescripcion" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>Semirremolque:</strong>
                    </td>
                    <td>
                        <asp:TextBox ID="txtSemi" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                    <td>
                        <strong>Tanque:</strong>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTanque" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>Ring Master:</strong>
                    </td>
                    <td>
                        <asp:TextBox ID="txtRingM" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                    <td>
                        <strong>Tablero:</strong>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTablero" runat="server" ReadOnly="true" Width="80%"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Botones" runat="Server">
    <input id="Button1" type="button" value="Aceptar" style="width: 100px; margin-right: 20px;"
        onclick="validar();" />
    <input id="Button2" type="button" value="Cancelar" style="width: 100px; margin-right: 20px;"
        onclick="window.close();" />
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Grilla" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="Grilla" runat="server" PageSize="20" AllowPaging="True" EmptyDataText="No hay Datos."
                ShowHeaderWhenEmpty="True" Width="100%" AutoGenerateColumns="False" OnPageIndexChanging="grilla_PageIndexChanging"
                OnSelectedIndexChanged="Grilla_SelectedIndexChanged" OnRowDataBound="Grilla_RowDataBound"
                DataKeyNames="Id" CellSpacing="2" BorderStyle="Solid" BorderWidth="2px" BorderColor="#2262FA"
                AllowSorting="True" OnSorting="Grilla_Sorting">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" SelectImageUrl="~/App_Themes/go.ico" SelectText="Editar"
                        ButtonType="Image">
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CommandField>
                    <asp:BoundField DataField="Movex" HeaderText="Plant Number" SortExpression="2" />
                    <asp:BoundField DataField="Descripcion" HeaderText="Descripción" SortExpression="3" />
                    <asp:BoundField DataField="NroCammesa" HeaderText="N° Cammesa" SortExpression="4" />
                    <asp:BoundField DataField="ModuloAsig" HeaderText="Modulo Asig." SortExpression="5" />
                    <asp:BoundField DataField="ModeloGKQ" HeaderText="Modelo GEN" SortExpression="6" />
                    <asp:BoundField DataField="Ubicacion" HeaderText="Ubicación" SortExpression="7" />
                    <asp:BoundField DataField="MovexSemi" HeaderText="Semirremolque" SortExpression="8" />
                    <asp:BoundField DataField="MovexTanque" HeaderText="Tanque" SortExpression="9" />
                    <asp:BoundField DataField="MovexRingM" HeaderText="Ring Master" SortExpression="10" />
                    <asp:BoundField DataField="MovexTablero" HeaderText="Tablero" SortExpression="11" />
                    <asp:BoundField DataField="Importacion" HeaderText="Importación" SortExpression="12" />
                </Columns>
                <HeaderStyle BackColor="#2262FA" Font-Bold="True" Font-Size="Small" ForeColor="White"
                    Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />
                <PagerStyle BackColor="#2262FA" Font-Bold="True" Font-Size="Small" ForeColor="White"
                    Height="10px" HorizontalAlign="Center" VerticalAlign="Middle" />
                <SelectedRowStyle BackColor="#999999" Font-Bold="True" Font-Size="Small" ForeColor="White"
                    Height="20px" VerticalAlign="Middle" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <aut:Autenticador ID="Autenticacion" runat="server" PermisosRequeridos="Default" />
</asp:Content>
